home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / lk_df.zip / DFBITS.H < prev    next >
Text File  |  1993-02-23  |  806b  |  25 lines

  1. /*
  2.  * dfbits.h - union to define flags for drives to check
  3.  *            (and for setting and clearing en masse)
  4.  *
  5.  *          (Some more of the tech writer's demented hacking)
  6.  *
  7.  *    drive_bits contains an array of 26 flags, used to determine
  8.  *     whether we want to check a certain drive.  Bit 0 (LSB) is the
  9.  *    flag for drive A:, bit 1 for drive B:, and so on.  A few defines
  10.  *    here make the main code a bit more readable.
  11.  */
  12.  
  13. static long drive_bits;
  14.  
  15. /* need to set or clear 26 bits at once */
  16. #define SET_ALL(db)   db = 0x03FFFFFF
  17. #define CLEAR_ALL(db) db =          0
  18.  
  19. /* also need to set or clear one at a time */
  20. #define SET_BIT(db, bn)   db |=  (1 << bn)
  21. #define CLEAR_BIT(db, bn) db &= ~(1 << bn)
  22.  
  23. /* don't forget to read a bit */
  24. #define GET_BIT(db, bn)   (db & (1 << bn))
  25.